#ifndef _PARTHUS_SYS_HAL_CONFIG_H
#define _PARTHUS_SYS_HAL_CONFIG_H

/***********************************************************************
 *
 * MODULE NAME:    sys_hal_config.h
 * PROJECT CODE:   BlueStream
 * MAINTAINER:     Daire.McNamara@parthusceva.com
 * DATE:           Wed Jul 14 11:39:10 BST 1999
 *
 * SOURCE CONTROL: $Id: sys_hal_config.h,v 1.4 2008/11/08 07:30:07 tianwq Exp $
 *
 * LICENCE:
 *    This source code is copyright (c) 1999-2004 Ceva Inc.
 *    All rights reserved.
 *
 * REVISION HISTORY:
 *    08 March 2001 - Initially added by JS
 *
 ***********************************************************************/

void SYShal_config_Initialise(void);
void SYSHal_Config_Apply(u_int8 id, u_int8 length, u_int8 *data);

void SYShalconfig_Get_Stored_BD_ADDR(const u_int8 *data);
void SYShalconfig_Get_Stored_Unit_Key(u_int8 *data);

u_int16 SYShalconfig_Map_Extend_Command(u_int16 opcode);


u_int8 Sys_HasEEprom(void);
u_int8 Sys_HasPatchTest(void);


/*
 * ARM platform specific compiler constants
 */

#ifndef XStr
    /*
     * the following 2 macros allow the expansion of a (numeric) macro
     * as a quoted string
     */
    #define Str(x) #x
    #define XStr(x) Str(x)
#endif

#if (defined(__arm) && !defined(__GNUC__))

    #if defined(__USE_INLINES__)
        #define __INLINE__ __inline
    #endif

    #if (!defined(__GNUC__) && (__ARMCC_VERSION >= 5))

        #define __COMPILER_VERSION__ "ARM Compiler SDK 2.50 or higher ("##XStr(__ARMCC_VERSION)##")"
        #define __IRQ__ __irq

    #else

        #define __COMPILER_VERSION__ "ARM Compiler "##XStr(__ARMCC_VERSION)
        #define __IRQ__ __irq

    #endif

#elif (defined(__thumb) && !defined(__GNUC__))

    #if defined(__USE_INLINES__)
        #define __INLINE__ __inline
    #endif

    #if (__ARMCC_VERSION >= 4.90)

        #define __COMPILER_VERSION__ "ARM Compiler SDK 2.50 or higher ("##XStr(__ARMCC_VERSION)##")"
        #define __IRQ__ __irq

    #else

        #define __COMPILER_VERSION__ "ARM Compiler (Thumb) "##XStr(__ARMCC_VERSION)
        #define __IRQ__ __irq

    #endif

#elif defined(__GNUC__)
    /* GCC's version macro is not numeric, but a string */
    #if defined(__USE_INLINES__)
        #define __INLINE__ __inline__ extern
    #endif

    #define __COMPILER_VERSION__ "GNU CC "##__VERSION__
    #define __IRQ__

    /*
     * GCC does not define endianness, but ARM compiler does
     */
    #ifndef __LITTLE_ENDIAN

        #ifndef __BIG_ENDIAN

            #define __LITTLE_ENDIAN

        #endif

    #endif

#endif /* defined(__GNUC__) */

/*
**  for chimera boards where tabasco is clocked from the radio board
*/
#if (PRH_BS_CFG_TABASCO_VERSION >= PRH_BS_HW_TABASCO_VERSION_P7_5_0)
#define TABASCO_CLOCKED_FROM_RADIO 1
#else
#define TABASCO_CLOCKED_FROM_RADIO 0
#endif

#endif /* _PARTHUS_SYS_HAL_CONFIG_H */

